﻿@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Defaults.cshtml";
}

<div ng-app="app" ng-controller="DemoCtrl">                     
   
     <div class="row-fluid"><div class="span6">
         <div id="DataTables_Table_0_length" class="dataTables_length" ng-show="showAdd()">
                <a class="btn btn-info" ng-click="appDialog(false,null)">
										<i class="glyphicon glyphicon-plus icon-white"></i>  
										Thêm mới                                           
	            </a>
         </div>

                            </div>
         <div class="span6">
            
             <div class="control-group">							  
							  <div class="controls">
                                <div class="search">
                                    Tìm : <input type="text" ng-model="search.$" />
                                </div>								
							  </div>
						</div>
         </div>

     </div>

     <table class="table table-striped table-bordered bootstrap-datatable datatable">
            <tr>
                <th>Tên Tài Khoản</th>
                <th>Email</th>
                <th>Điện thoại</th>
                <th></th>
            </tr>
            <tr ng-repeat="task in tasks | orderBy : 'tENBAN' | filter:search">
                <td> {{task.user_name}}</td>
                <td> {{task.email}}</td>
                <td> {{task.phone}}</td>

                 <td class="center">
                     <div ng-show="showEdit()">                     
                    <a class="btn btn-info" ng-click="appDialog(true,task)">
										<i class="icon-edit icon-white"></i>  
										Sửa                                            
									</a>
                         </div>
                     <div ng-show="showDelete()">
									<a class="btn btn-danger" ng-click="delete(task.id)">
										<i class="icon-trash icon-white"></i> 
										Xóa
									</a>
                         </div>
                </td>    

            </tr>
        </table>

        <div ng-controller="DialogCtrl">
            <jqdialog dialog-name="App" title="'Đạo pháp'"
                      auto-open="false" width="850" height="450"
                      on-open="onOpen" buttons="{'Lưu': onOk, 'Hủy': onCancel, 'Đóng': 'close' }"
                      args-to-scope="true"
                      before-close="beforeClose">                
                <form class="form-horizontal">
                    <fieldset>
                        <div class="control-group">
							  <label class="control-label" for="user_name">Tài Khoản : </label>
							  <div class="controls">
								<input id="user_name" ng-model="obj.user_name"/>				
							  </div>
						</div>
                        
                        <div class="control-group">
							  <label class="control-label" for="pass_word">Mật Khẩu : </label>
							  <div class="controls">
								<input id="pass_word" ng-model="obj.pass_word"/>				
							  </div>
						</div>
                        <div class="control-group">
							  <label class="control-label" for="email">Email : </label>
							  <div class="controls">
								<input id="email" ng-model="obj.email"/>				
							  </div>
						</div>

                        <div class="control-group">
							  <label class="control-label" for="phone">Điện thoại : </label>
							  <div class="controls">
								<input id="phone" ng-model="obj.phone"/>				
							  </div>
						</div>
                          <div class="control-group">
                                  <label class="control-label" for="selectError">Nhóm</label>
                                  <div class="controls">
                                        <select ng-model="obj.type_id" id="type_id" >
                                            <option ng-repeat="item in gusers" value="{{item.id}}">{{item.group_name}}</option>
                                        </select>
                                  </div>
                          </div>
                    </fieldset>
                </form>                
            </jqdialog>
        </div>
 </div>

<script src="~/Content/lib/jquery-1.8.3.js"></script> 
<script src="~/Content/lib/jquery-ui.js"></script>
<script src="~/Content/lib/angular.js"></script>
<script src="~/Content/lib/module.js"></script>
<script src="~/Content/js/jqdialog/jqdialog.js"></script>
<script src="~/Content/md/user/user.js"></script>
<script>
    $("#dscv").html("Danh Sách Người Dùng");
</script>
